<script setup lang="ts">
import { computed } from 'vue';

const props: any = defineProps<{
    ujt: any;
}>();
const { $global }: any = props.ujt;

const cmZindex: any = computed(() => {
    return $global.pagebusy?.zindex || 9999;
});
</script>

<template>
    <div
        class="as-pagebusy-area touch-none"
        v-if="$global.pagebusy"
        v-dbpointerdown="
            () => {
                $global.pagebusy?.keep ? '' : ($global.pagebusy = null);
            }
        "
    >
        <div
            class="as-pagebusy-spin"
            :style="{
                width: '68px',
                height: '68px',
                ...($global.pagebusy?.style || {}),
            }"
        ></div>
        <div class="as-pagebusy-v">{{ $global.pagebusy?.v }}</div>
    </div>
</template>
<style scoped lang="scss">
.as-pagebusy-area {
    cursor: not-allowed;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: v-bind('cmZindex');

    .as-pagebusy-spin {
        border: 18px solid var(--cm6);
        border-top: 18px solid var(--cm0);
        border-radius: 50%;
        animation: spin 1s linear infinite;
    }

    .as-pagebusy-v {
        padding: 10px;
        // font-weight: bold;
        font-size: var(--fs2);
        // background-color: var(--cm0);
        // border-radius: var(--radius);
        color: var(--cm8);
    }
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}
</style>
